var express = require('express');
var db = require('../../../tools/database')
var util = require('../../../tools/util')

var router = express.Router();

// 获取用户发布的商品信息
router.use(function (req, res, next) {
	// 验证 token, 获取用户名
	util.jwtVerify(req, res, (decoded) => {
		let userName = decoded.userName;
		sql = `SELECT * FROM Items WHERE UserName=?`
		db.queryRespond(sql, [userName], res)
	})
});


module.exports = router;